﻿using System.IO;
//using org.mayb.Fixtures;
using System.Reflection;
using org.mayb.Fixtures;
using TestModel;

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Fixtures.RegisterAssembly(Assembly.Load("TestModel"));

            OrderManagerDataContext dataContext = new OrderManagerDataContext("server=localhost\\SQLEXPRESS;Database=OrderMan;Integrated Security=SSPI;");
            
            if(dataContext.DatabaseExists())
                dataContext.DeleteDatabase();

            dataContext.CreateDatabase();

            string directory = Directory.GetCurrentDirectory() + "\\Fixtures";

            Fixtures.LoadFixtures(new string[] {directory}, dataContext );

            dataContext.SerializeToFixtures("C:\\Fixtures");
        }
    }
}
